#include "qdesignerplugin.h"

#include "qdesignerwidget.h"

#include <qplugin.h>
#include <QIcon>
#include <QVariant>

QString QDesignerPlugin::pluginName()
{
    return "Designer.Plugin";
}

void QDesignerPlugin::createWidget()
{
    m_widget=new QDesignerWidget;
    m_widget->setProperty("panelwidget",true);
    m_widget->setProperty("page_position",getPageName());
}

QString QDesignerPlugin::getPageName()
{
    return tr("Designer");
}

QIcon QDesignerPlugin::getPageIcon()
{
    return QIcon(":/images/design.png");
}

int QDesignerPlugin::getIndex()
{
    return 2;
}

bool QDesignerPlugin::getEnabled()
{
    return true;
}

bool QDesignerPlugin::pagePosition(const QVariant &param)
{
    return ((QDesignerWidget*)m_widget)->pagePosition(param);
}

Q_EXPORT_PLUGIN2(QDesignerPlugin,QDesignerPlugin)
